home *** CD-ROM | disk | FTP | other *** search
/ Internet 53 / INTERNET53.iso / pc / software / windows / building / coldfusion studio evaluation / data1.cab / CFS_Wizards / CFML / Ldap_LdapEdit.wml < prev    next >
Encoding:
Text File  |  1998-10-08  |  2.1 KB  |  75 lines

  1. <WIZSET AttributesWithoutDN = ''>
  2.  
  3. <WIZLOOP index="AttrName" list="$${Attributes}">
  4.     <WIZIF LCase(Trim(AttrName)) NEQ 'dn'>
  5.         <WIZSET AttributesWithoutDN = AttributesWithoutDN & Trim(AttrName) & ','>
  6.     </WIZIF>
  7. </WIZLOOP>
  8.  
  9. <WIZIF AttributesWithoutDN NEQ ''>
  10.     <WIZSET AttributesWithoutDN = Left( AttributesWithoutDN, Len(AttributesWithoutDN) - 1 )>
  11. </WIZIF>
  12.  
  13. <!--- list of all attributes (excluding DN) --->
  14. <CFSET Attributes = '$${AttributesWithoutDN}'>
  15.  
  16.  
  17. <!--- if parameter DN has been passed - EDIT ENTRY --->
  18. <CFIF ParameterExists( URL.dn )>
  19.     <CFLDAP NAME="GetRecord"
  20.             SERVER="$${ServerName}"
  21.             PORT="$${ServerPort}"
  22.             USERNAME="$${Username}"
  23.             PASSWORD="$${Password}"
  24.             ACTION="query"
  25.             START="#URL.dn#"
  26.             SCOPE="base"
  27.             ATTRIBUTES="#Attributes#"
  28.             TIMEOUT="$${Timeout}"
  29.             MAXROWS="1"
  30.     >
  31.  
  32. <WIZLOOP index="AttrName" list="$${AttributesWithoutDN}">
  33.     <CFSET $${AttrName}_FormValue = HTMLEditFormat(GetRecord.$${AttrName})>
  34. </WIZLOOP>
  35. <!--- ... else parameter DN has not been passed - ADD ENTRY --->
  36. <CFELSE>
  37.  
  38. <WIZLOOP index="AttrName" list="$${AttributesWithoutDN}">
  39.     <CFSET $${AttrName}_FormValue = ''>
  40. </WIZLOOP>
  41. </CFIF>
  42.  
  43. <HTML><HEAD>
  44.     <TITLE>$${ApplicationName} - Edit Record</TITLE>
  45. </HEAD><BODY bgcolor="ffffff">
  46.  
  47. <FONT size="+1">$${ApplicationName}</FONT> <BR>
  48. <FONT size="+2"><B>Edit Record</B></FONT>
  49.  
  50.  
  51. <FORM action="$${SafeApplicationName}_LdapAction.cfm" method="post">
  52.  
  53. <INPUT type="hidden" name="Attributes" value="<CFOUTPUT>#Attributes#</CFOUTPUT>">
  54. <CFIF ParameterExists(URL.dn)>
  55.     <INPUT type="hidden" name="dn" value="<CFOUTPUT>#URL.dn#</CFOUTPUT>">
  56. </CFIF>
  57.  
  58. <TABLE>
  59. <CFOUTPUT>
  60. <WIZLOOP index="AttrName" list="$${AttributesWithoutDN}">
  61.     <TR><TD>$${AttrName}</TD>
  62.         <TD><INPUT type="text" name="$${AttrName}" value="#$${AttrName}_FormValue#" size=20>
  63.             <INPUT type="hidden" name="$${AttrName}_required" value="You cannot leave the '$${AttrName}' field blank." >
  64.         </TD>
  65.     </TR>
  66. </WIZLOOP>
  67. </CFOUTPUT>
  68. </TABLE>
  69.  
  70. <INPUT type="submit" name="btnEdit_OK" value="    OK    ">
  71. <INPUT type="submit" name="btnEdit_Cancel" value="Cancel">
  72.  
  73. </FORM>
  74.  
  75. </BODY></HTML>